<?php if(isset($members_) && is_array($members_) && !empty($members_)){?>
		<table class="display" cellpadding="10" cellspacing="10">
		
			<tr>			
			<?php
			// liczba rekordow
			$catsCnt = count($members_);
			$columns = 5;
			
			foreach ($members_ as $k => $member):
			?>
			
			<?php     	
				if(($k+1) % $columns == 0) { 
					echo "<td width=\"".(100/$columns)."%\" valign=\"top\" align=\"center\" class=\"last\">";
			?>
				
					<table cellpadding="0" cellspacing="0" class="display-info">
					<?php if($session->check('Auth.User.id')){?>
					<tr>
						<td>
							<?php echo $this->Html->link(__('edit',true), 
							array('plugin'=>'members','controller'=>'members','action'=>'edit',$member['Member']['id']),
							array('escape'=>false)); ?>
							
							<?php echo $this->Html->link(__('usuń',true), 
							array('plugin'=>'members','controller'=>'members','action'=>'delete',$member['Member']['id']),
							array('escape'=>false), sprintf(__d('store','Are you sure you want to delete # %s?', true), $member['Member']['id'])); ?>						
						</td>
					</tr>
					<?php }?>
					<?php if(!empty($member['Member']['country'])){?>
					<tr>
						<td align="center"><strong><?php echo $member['Member']['country']; ?></strong></td></tr>
					<?php }?>
					</table>
					
				<div class="image-icons-list">			
					<?php echo $fileUpload->image($member['MemberUpload']['name'],array('autoResize'=>true,'width'=>200,'imagePathOnly'=>false)); ?>&nbsp;
					<div class="clr"></div>	
				</div>
				<div class="clr"></div>	
				<table cellpadding="0" cellspacing="0" class="display-info">
					<?php if(!empty($member['Member']['full_name'])){?>
					<tr>
						<td align="center" colspan="2"><strong><?php echo $member['Member']['full_name']; ?></strong></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['name'])){?>
					<tr>						
						<td align="center" colspan="2"><?php echo $member['Member']['name']; ?></td>	</tr>
					<?php }?>
					<?php if(!empty($member['Member']['city'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('City:',true)?></td>
						<td align="left"><?php echo $member['Member']['zip']; ?> <?php echo  $member['Member']['city']; ?></td></tr>
					<?php }?>
					
					<?php if(!empty($member['Member']['address1'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Address:',true)?></td>
						<td align="left" ><?php echo $member['Member']['address1']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['address2'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Address:',true)?></td>
						<td align="left"><?php echo $member['Member']['address2']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['tel_no'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Tel.:',true)?></td>
						<td align="left"><?php echo $member['Member']['tel_no']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['mob_no'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Mob.:',true)?></td>
						<td align="left"><?php echo $member['Member']['mob_no']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['fax_no'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Fax.:',true)?></td>
						<td align="left"><?php echo $member['Member']['fax_no']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['e_mail'])){?>
					<tr>
						<td align="center" colspan="2"><?php echo $member['Member']['e_mail']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['e_mail_2'])){?>
					<tr>
						<td align="center" colspan="2"><?php echo $member['Member']['e_mail_2']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['www_'])){?>
					<tr>
						<td align="center" colspan="2"><?php echo $html->link($member['Member']['www_'],$member['Member']['www_']); ?></td></tr>
					<?php }?>
				</table>
			<?php echo "</td></tr>"; 
			      if ($k!=($catsCnt-1)) echo "<tr>"; 
			        } else { 
			       echo "<td width=\"".(100/$columns)."%\" valign=\"top\" align=\"center\">";			    
			?>
				
					<table cellpadding="0" cellspacing="0" class="display-info">
					<?php if($session->check('Auth.User.id')){?>
					<tr>
						<td>
							<?php echo $this->Html->link(__('edytuj',true), 
							array('plugin'=>'members','controller'=>'members','action'=>'edit',$member['Member']['id']),
							array('escape'=>false)); ?>
							
							<?php echo $this->Html->link(__('usuń',true), 
							array('plugin'=>'members','controller'=>'members','action'=>'delete',$member['Member']['id']),
							array('escape'=>false), sprintf(__d('store','Are you sure you want to delete # %s?', true), $member['Member']['id'])); ?>						
						</td>
					</tr>
					<?php }?>
					<?php if(!empty($member['Member']['country'])){?>
					<tr>
						<td align="center"><strong><?php echo $member['Member']['country']; ?></strong></td></tr>
					<?php }?>
					</table>
				
				<div class="image-icons-list">	
				<?php echo $fileUpload->image($member['MemberUpload']['name'],array('autoResize'=>true,'width'=>200,'imagePathOnly'=>false)); ?>&nbsp;
				</div>
				<table cellpadding="0" cellspacing="0" class="display-info">
					<?php if(!empty($member['Member']['full_name'])){?>
					<tr>
						<td align="center" colspan="2"><strong><?php echo $member['Member']['full_name']; ?></strong></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['name'])){?>
					<tr>						
						<td align="center" colspan="2"><?php echo $member['Member']['name']; ?></td>	</tr>
					<?php }?>

					<?php if(!empty($member['Member']['city'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('City:',true)?></td>
						<td align="left"><?php echo $member['Member']['zip']; ?> <?php echo $member['Member']['city']; ?></td></tr>
					<?php }?>

					<?php if(!empty($member['Member']['address1'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Address:',true)?></td>
						<td align="left"><?php echo $member['Member']['address1']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['address2'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Address:',true)?></td>
						<td align="left" ><?php echo $member['Member']['address2']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['tel_no'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Tel.:',true)?></td>
						<td align="left"><?php echo $member['Member']['tel_no']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['mob_no'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Mob.:',true)?></td>
						<td align="left"><?php echo $member['Member']['mob_no']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['fax_no'])){?>
					<tr>
						<td align="right" class="description"><?php echo __('Fax.:',true)?></td>
						<td align="left"><?php echo $member['Member']['fax_no']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['e_mail'])){?>
					<tr>
						<td align="center" colspan="2"><?php echo $member['Member']['e_mail']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['e_mail_2'])){?>
					<tr>
						<td align="center" colspan="2"><?php echo $member['Member']['e_mail_2']; ?></td></tr>
					<?php }?>
					<?php if(!empty($member['Member']['www_'])){?>
					<tr>
						<td align="center" colspan="2"><?php echo $html->link($member['Member']['www_'],$member['Member']['www_']); ?></td></tr>
					<?php }?>
				</table>
			<?php echo "</td>"; 
			    	}
			 ?> 
			<?php endforeach; ?>
			<?php 	// uzupełnienie ostatniego rekordu
				$numSpaces = $columns - ($catsCnt % $columns); 
			    if ($numSpaces!=0 && $numSpaces != $columns ) { 
			        for ($j=0;$j<$numSpaces;$j++) { 
			        	$last = ($j == $numSpaces -1) ? "class=\"last\"" :"";
			            echo "<td  width=\"".(100/$columns)."%\" {$last}>&nbsp;</td>"; 
			        } 
			        echo "</tr>"; 
			    }
			?>					
					
			</table>
<?php }?>

<?php if($session->check('Auth.User.id')){?>
<?php echo $this->element('toolbar_actions_main',array('plugin'=>'members','toolbar'=>'members'))?>
<?php }?>